﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Admin.Core.Common.Output;
using Admin.Core.Service.Admin.MenuKj;
using Admin.Core.Service.Admin.MenuKj.Input;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Admin.Core.Controllers.Admin
{
    public class MenuKjController : AreaController
    {

        private readonly IMenuKjService _menuKjService;

        public MenuKjController(IMenuKjService menuKjService)
        {
            _menuKjService = menuKjService;
        }

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<IResponseOutput> Add(MenuKjInput input)
        {
            return await _menuKjService.AddAsync(input);
        }

        /// <summary>
        /// 查询快捷菜单列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IResponseOutput> GetMenuKjList()
        {
            return await _menuKjService.GetMenuKjListAsync();
        }


        /// <summary>
        /// 删除快捷菜单
        /// </summary>
        /// <returns></returns>
        [HttpDelete]
        public async Task<IResponseOutput> DeleteMenuKj(long id)
        {
            return await _menuKjService.DeleteAsync(id);
        }
    }
}